<script src="__JS__/jquery.min.js"></script>
<link rel="stylesheet" href="__JS__/layui/css/layui.css" media="all">
<div class="layui-body" style="position: static;">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                {if condition = "$poster['poster']"}
                    <div style="width:100%;">
                        <img style="width: 100%;" src="{$poster.poster}" alt="">
                    </div>
                    <div style="padding-top: 15px;">
                        <button class="layui-btn layui-btn-danger" onclick="deletePoster({$poster.id});">删除</button>
                    </div>
                {else /}
                    <form id="dasdasdasd" class="layui-form form-container" action="">
                        <div class="layui-form-item">
                            <label class="layui-form-label">海报上传</label>
                            <div class="layui-input-block">
                                <input type="file" name="poster" class="layui-upload-file" id="poster" multiple="multiple">
                                <input type="hidden" id="pos" name="poster" value="" />
                                <div id="poster_img" style="width:200px;padding-top: 15px;"></div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">二维码上传</label>
                            <div class="layui-input-block">
                                <input type="file" name="file" class="layui-upload-file" id="pop" multiple="multiple">
                                <input type="hidden" id="qrcode_ipt" name="qrcode" value="" />
                                <div class="qrcode_img" style="padding-top: 15px;"></div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">X轴</label>
                            <div class="layui-input-block">
                                <input type="text" name="x" value="" required lay-verify="required" placeholder="请输入X轴" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">Y轴</label>
                            <div class="layui-input-block">
                                <input type="text" name="y" value="" required lay-verify="required" placeholder="请输入Y轴" class="layui-input">
                            </div>
                        </div>

                        <!-- <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="*">确认合成</button>
                            </div>
                        </div> -->
                    </form>
                {/if}
            </div>
        </div>
    </div>
</div>
<script>
    // 定义全局JS变量
    var GV = {
        current_controller: "admin/{$controller|default=''}/",
        base_url: "__STATIC__"
    };

    function deletePoster(id){
        $.ajax({
            url:"/admin/custm_svc/delPoster",
            type:"post",
            data:{id:id},
            success:function(res){
                if(res.status == 1){
                    layer.msg('删除成功',{time:2000},function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg('删除失败');
                }
            }
        });
    }
</script>
<script src="__JS__/layui/lay/dest/layui.all.js"></script>
<script src="__JS__/admin.js"></script>